// generating config files for a physical node
// Created: Apr. 13, 2023 by SUN Yazhou, asia.rabbit@163.com

#include "CMC.h"

CMC::CMC(const Node &n) : PN(n, CRATE_CMC), fRiData(0), fMiCmd(0), fRiSta(0){}
CMC::~CMC(){}

// configure all the lns //
void CMC::Ln(){
  LN *ds0 = data_save(0), *sc1 = sys_console_gui(1);
  // data stream //
  LN *ri2 = reduce_index(2, DATA);
  *ri2 >> *ds0;
  // cmd stream //
  LN *mi3 = map_index(3, CMD);
  *sc1 >> *mi3;
  // status stream //
  LN *ri4 = reduce_index(4, STA);
  *ri4 >> *sc1;
  // assign interfacing ports //
  fRiData = ri2; fMiCmd = mi3; fRiSta = ri4;
} // end member function Ln
